import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        isNight: false
    },
    mutations: {
        night(state) {
            state.isNight = true
        },
        day(state) {
            state.isNight = false
        }
    },
    actions: {
        changeNight(e) {
            e.commit('night')
        },
        changeDay(e) {
            e.commit('day')
        }
    },
    getters: {
        nightData(state) {
            return state.isNight
        }
    },
    modules: {}
})